<?php include $this->tpl('public:common.php') ?>

<div class="btn-toolbar"  style="margin-bottom:2px;">
    <a href="/os/region/add"  class="btn btn-primary"><i class="icon-plus"></i> 地区</a>
	<a data-toggle="collapse" data-target="#search"  href="#" title= "检索"><button class="btn btn-primary" style="margin-left:5px"><i class="icon-search"></i></button></a>
</div>
<?php if(get('search')):?>
<div id="search" class="collapse in">
<?php else:?>
<div id="search" class="collapse out" >
<?php endif ?>
<form class="form_search"  action="" method="GET" style="margin-bottom:0px">
	<div style="float:left;margin-right:5px">
		<label>省份</label>
		<input type="text" name="province" id="province" value="<?=get('province')?>" class="input-small">
	</div>
	<div style="float:left;margin-right:5px">
		<label>城市</label>
		<input type="text" name="city" id="city" value="<?=get('city')?>" class="input-small">
	</div>
	<div style="float:left;margin-right:5px">
		<label>区域</label>
		<input type="text" name="district" id="district" value="<?=get('district')?>" class="input-small">
		<input type="hidden" name="search" value="1" >
	</div>
	<div class="btn-toolbar" style="padding-top:25px;padding-bottom:0px;margin-bottom:0px">
		<button type="submit" class="btn btn-primary">检索</button>
	</div>
	<div style="clear:both;"></div>
</form>
</div>

    <div class="block">
        <a href="#page-stats" class="block-heading" data-toggle="collapse">功能列表</a>
        <div id="page-stats" class="block-body collapse in">

               <table class="table table-striped">
              <thead>
                <tr>
					<th style="width:30px">#</th>
					<th style="width:90px">名称</th>
					<th style="width:180px">编号</th>
					<th style="width:80px">操作</th>
                </tr>
              </thead>
              <tbody>							  
					 <?php foreach ($regions as $region): ?>
					<tr>
					 
					<td><?=$region['id']?></td>
					<td><?=$region['name']?></td>
					<td><?=$region['sn']?></td>
					<td>
					<?php if($view_type):?>
						<a href="/os/region?fid=<?=$region['sn']?>&type=<?=$type?>" title= "查看下级<?=$view_type?>" ><i class="icon-list"></i></a>
						&nbsp;
					<?php endif?>
					<a href="/os/region/update?id=<?=$region['id']?>&type=<?=$type?>" title= "修改" ><i class="icon-pencil"></i></a>
					&nbsp;
					<a data-toggle="modal" href="#myModal" title= "删除" ><i class="icon-remove" href="/os/regions/delete?id=<?=$region['id']?>&type=<?=$type?>" ></i></a>
					</td>
					</tr>
				<?php endforeach?>
              </tbody>
            </table> 
<!--- START 分页模板 --->
               <?=$page_html?>
<!--- END 分页--->			   
        </div>
    </div>
	
<?php include $this->tpl("public:footer.php" ) ?>